package com.wcy.bysj.service.impl;

import com.wcy.bysj.common.Result;
import com.wcy.bysj.dao.ClassMapper;
import com.wcy.bysj.entity.Class;
import com.wcy.bysj.service.ClassService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ClassServiceImpl implements ClassService {

    @Autowired
    private ClassMapper classMapper;

    @Override
    public Result selectAllClass(Class c) {
        List<Class> list = classMapper.selectAllClass(c);
        return Result.success(list);
    }

    @Override
    public Result addClass(Class c) {
        int i = classMapper.insertClass(c);
        return Result.success(i);
    }

    @Override
    public Result updateClass(Class c) {
        int i = classMapper.updateClass(c);
        return Result.success(i);
    }

    @Override
    public Result deleteClass(Class c) {
        int i = classMapper.deleteClass(c);
        return Result.success(i);
    }
}
